package logger

import (
	"os"
	"time"
)

type logger struct {
}

var Logger logger

func init() {
	Logger = logger{}
}

func (l logger) Write(p []byte) (n int, err error) {
	time := []byte(time.Now().String())
	f, err := os.OpenFile("./logs/"+string(time[:10])+".log", os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666)

	return f.Write(p)
}
